﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using Iacym.Repository.Mapping;
using Iacym.Entities;

namespace Iacym.Repository
{
    public class IACYMCONTEXT : DbContext
    {

        static IACYMCONTEXT()
        {
            Database.SetInitializer<IACYMCONTEXT>
                (
                   null
                    //new DropCreateDatabaseIfModelChanges<IACYMCONTEXT>()
                   //new DropCreateDatabaseAlways<IACYMCONTEXT>()
                //new IacymDatabaseInitializer()
                );
        }

        public IACYMCONTEXT()
            : base("Name=IACYMCONTEXT")
        {
            this.Configuration.LazyLoadingEnabled = false;
            this.Configuration.ProxyCreationEnabled = false;
            this.Configuration.AutoDetectChangesEnabled = false;
        }

        public DbSet<Agendum> AGENDA { get; set; }
        public DbSet<ASISTENCIA> ASISTENCIAs { get; set; }
        public DbSet<BAJA> BAJAS { get; set; }
        public DbSet<CARGO> CARGOes { get; set; }
        public DbSet<CARGO_IGLESIA> CARGO_IGLESIA { get; set; }
        public DbSet<CELULA> CELULAs { get; set; }
        public DbSet<DATOS_TRANSFERENCIA> DATOS_TRANSFERENCIA { get; set; }
        public DbSet<DETALLE_ASISTENCIA> DETALLE_ASISTENCIA { get; set; }
        public DbSet<DETALLE_CARGO> DETALLE_CARGO { get; set; }
        public DbSet<DETALLE_CITA> DETALLE_CITA { get; set; }
        public DbSet<EMPRESA> EMPRESAs { get; set; }
        public DbSet<ESCUELA> ESCUELAS { get; set; }
        public DbSet<ESPECIALIDAD> ESPECIALIDADs { get; set; }
        public DbSet<ESTADO_CIVIL> ESTADO_CIVIL { get; set; }
        public DbSet<ESTUDIOS_BIBLICOS> ESTUDIOS_BIBLICOS { get; set; }
        public DbSet<FOTO_PERSONA> FOTO_PERSONA { get; set; }
        public DbSet<HIJO> HIJOS { get; set; }
        public DbSet<HISTORIAL_ESTADO_CIVIL> HISTORIAL_ESTADO_CIVIL { get; set; }
        public DbSet<HISTORIAL_MINISTERIO> HISTORIAL_MINISTERIO { get; set; }
        public DbSet<IDIOMA> IDIOMAS { get; set; }
        public DbSet<IGLESIA> IGLESIAs { get; set; }
        public DbSet<LIBRO> LIBROes { get; set; }
        public DbSet<LIBRO_IMAGEN> LIBRO_IMAGEN { get; set; }
        public DbSet<LINEA_TELEFONICA> LINEA_TELEFONICA { get; set; }
        public DbSet<MATRIMONIO> MATRIMONIOs { get; set; }
        public DbSet<MENU> MENUs { get; set; }
        public DbSet<MINISTERIO> MINISTERIOs { get; set; }
        public DbSet<MOTIVO> MOTIVOes { get; set; }
        public DbSet<OFRENDA> OFRENDAs { get; set; }
        public DbSet<PERSONA> PERSONAs { get; set; }
        public DbSet<PERSONA_ESPECIALIDAD> PERSONA_ESPECIALIDAD { get; set; }
        public DbSet<PERSONA_IDIOMAS> PERSONA_IDIOMAS { get; set; }
        public DbSet<PERSONA_PROFESION> PERSONA_PROFESION { get; set; }
        public DbSet<PROCEDENCIA> PROCEDENCIAs { get; set; }
        public DbSet<PROFESION> PROFESIONs { get; set; }
        public DbSet<ROL> ROLs { get; set; }
        public DbSet<SEXO> SEXOes { get; set; }
        
        public DbSet<TELEFONO> TELEFONOS { get; set; }
        public DbSet<TIPO_MONEDA> TIPO_MONEDA { get; set; }
        public DbSet<TIPO_OFRENDA> TIPO_OFRENDA { get; set; }
        public DbSet<TIPO_PAGO> TIPO_PAGO { get; set; }
        public DbSet<TRABAJO> TRABAJOes { get; set; }
        public DbSet<UBIGEO> UBIGEOs { get; set; }
        public DbSet<USUARIO> USUARIOs { get; set; }
        public DbSet<USUARIO_MENU> USUARIO_MENU { get; set; }
        public DbSet<TIPO_REUNION> TIPO_REUNION { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new AgendumMap());
            modelBuilder.Configurations.Add(new ASISTENCIAMap());
            modelBuilder.Configurations.Add(new BAJAMap());
            modelBuilder.Configurations.Add(new CARGOMap());
            modelBuilder.Configurations.Add(new CARGO_IGLESIAMap());
            modelBuilder.Configurations.Add(new CELULAMap());
            modelBuilder.Configurations.Add(new DATOS_TRANSFERENCIAMap());
            modelBuilder.Configurations.Add(new DETALLE_ASISTENCIAMap());
            modelBuilder.Configurations.Add(new DETALLE_CARGOMap());
            modelBuilder.Configurations.Add(new DETALLE_CITAMap());
            modelBuilder.Configurations.Add(new EMPRESAMap());
            modelBuilder.Configurations.Add(new ESCUELAMap());
            modelBuilder.Configurations.Add(new ESPECIALIDADMap());
            modelBuilder.Configurations.Add(new ESTADO_CIVILMap());
            modelBuilder.Configurations.Add(new ESTUDIOS_BIBLICOSMap());
            modelBuilder.Configurations.Add(new FOTO_PERSONAMap());
            modelBuilder.Configurations.Add(new HIJOMap());
            modelBuilder.Configurations.Add(new HISTORIAL_ESTADO_CIVILMap());
            modelBuilder.Configurations.Add(new HISTORIAL_MINISTERIOMap());
            modelBuilder.Configurations.Add(new IDIOMAMap());
            modelBuilder.Configurations.Add(new IGLESIAMap());
            modelBuilder.Configurations.Add(new LIBROMap());
            modelBuilder.Configurations.Add(new LIBRO_IMAGENMap());
            modelBuilder.Configurations.Add(new LINEA_TELEFONICAMap());
            modelBuilder.Configurations.Add(new MATRIMONIOMap());
            modelBuilder.Configurations.Add(new MENUMap());
            modelBuilder.Configurations.Add(new MINISTERIOMap());
            modelBuilder.Configurations.Add(new MOTIVOMap());
            modelBuilder.Configurations.Add(new OFRENDAMap());
            modelBuilder.Configurations.Add(new PERSONAMap());
            modelBuilder.Configurations.Add(new PERSONA_ESPECIALIDADMap());
            modelBuilder.Configurations.Add(new PERSONA_IDIOMASMap());
            modelBuilder.Configurations.Add(new PERSONA_PROFESIONMap());
            modelBuilder.Configurations.Add(new PROCEDENCIAMap());
            modelBuilder.Configurations.Add(new PROFESIONMap());
            modelBuilder.Configurations.Add(new ROLMap());
            modelBuilder.Configurations.Add(new SEXOMap());
            
            modelBuilder.Configurations.Add(new TELEFONOMap());
            modelBuilder.Configurations.Add(new TIPO_MONEDAMap());
            modelBuilder.Configurations.Add(new TIPO_OFRENDAMap());
            modelBuilder.Configurations.Add(new TIPO_PAGOMap());
            modelBuilder.Configurations.Add(new TRABAJOMap());
            modelBuilder.Configurations.Add(new UBIGEOMap());
            modelBuilder.Configurations.Add(new USUARIOMap());
            modelBuilder.Configurations.Add(new USUARIO_MENUMap());
            modelBuilder.Configurations.Add(new TIPO_REUNIONMap());
        }

    }
}
